package com.battery.system.service.battery.impl;

import java.util.List;

import com.battery.system.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.battery.system.mapper.DeviceBasicsMapper;
import com.battery.system.domain.DeviceBasics;
import com.battery.system.service.battery.IDeviceBasicsService;
import com.battery.common.core.text.Convert;

/**
 * 设备基础信息Service业务层处理
 *
 * @author battery
 * @date 2021-01-22
 */
@Service
public class DeviceBasicsServiceImpl extends BaseServiceImpl<DeviceBasics> implements IDeviceBasicsService {
    @Autowired
    private DeviceBasicsMapper deviceBasicsMapper;

    /**
     * 查询设备基础信息
     *
     * @param deviceId 设备基础信息ID
     * @return 设备基础信息
     */
    @Override
    public DeviceBasics selectDeviceBasicsById(String deviceId) {
        return deviceBasicsMapper.selectDeviceBasicsById(deviceId);
    }

    /**
     * 查询设备基础信息列表
     *
     * @param deviceBasics 设备基础信息
     * @return 设备基础信息
     */
    @Override
    public List<DeviceBasics> selectDeviceBasicsList(DeviceBasics deviceBasics) {
        return deviceBasicsMapper.selectDeviceBasicsList(deviceBasics);
    }

    /**
     * 新增设备基础信息
     *
     * @param deviceBasics 设备基础信息
     * @return 结果
     */
    @Override
    public int insertDeviceBasics(DeviceBasics deviceBasics) {
        return deviceBasicsMapper.insertDeviceBasics(deviceBasics);
    }

    /**
     * 修改设备基础信息
     *
     * @param deviceBasics 设备基础信息
     * @return 结果
     */
    @Override
    public int updateDeviceBasics(DeviceBasics deviceBasics) {
        return deviceBasicsMapper.updateDeviceBasics(deviceBasics);
    }

    /**
     * 删除设备基础信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDeviceBasicsByIds(String ids) {
        return deviceBasicsMapper.deleteDeviceBasicsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备基础信息信息
     *
     * @param deviceId 设备基础信息ID
     * @return 结果
     */
    @Override
    public int deleteDeviceBasicsById(String deviceId) {
        return deviceBasicsMapper.deleteDeviceBasicsById(deviceId);
    }
}
